<template>
  <el-container style="width: 100%">
    <el-main style="padding: 0;margin-right: 20px">
      <el-card>
        <template #header>
          wqd
        </template>
        <h2>{{ postInfo.title }}</h2>
        <br>
        <wave-preview mode="page" :content="postInfo.content"/>
        <template #footer>
          qwjkdqijhg
        </template>
      </el-card>
    </el-main>
    <el-aside width="200px">
    </el-aside>
  </el-container>
  <comment-list :target-id="route.params.id"/>
</template>
<script setup>

import WavePreview from "@/component/WavePreview.vue";
import {postQuery} from "@/views/system/post/js/PostRequest.js";
import {useRoute,} from 'vue-router'
import {ref} from 'vue'
import CommentList from "@/views/system/comment/CommentList.vue";

const route = useRoute()
const postId = ref('')
const postInfo = ref({})

onBeforeMount(() => {
  // 获取路由参数
  postId.value = route.params.id
  postQuery({id: postId.value}).then(res => {
    if (res.success) {
      postInfo.value = res.data
    }
  })
})


</script>
<style scoped>


</style>